/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/media-picture.html#wxgetimageinfoobject)
 * @param src [string] 图片地址
 */
export default function preview_image(src: string) {
	return new Promise<{
		success: boolean;
		msg: {
			width: number;	// 图片宽度，单位px
			height: number;	// 图片高度，单位px
			path: string;	// 返回图片的本地路径
		}
	}>((resolve) => {
		wx.getImageInfo({
			src,
			success(res) {
				resolve({
					msg: res,
					success: true
				});
			},
			fail(res) {
				resolve({
					msg: res,
					success: false
				});
			}
		});
	});
}
